package org.example;

//import java.util.*;

import java.util.List;
//import java.util.ArrayList;
import java.util.LinkedList;

class t{

}

//堆溢出
public class OutOfMemoryError {
    public static void main(String[] args) throws ClassNotFoundException {
        Class<?> c = Class.forName("hhh");
    }
    //多线程下的内存溢出
    public static void main2(String[] args) {
        while (true) {
            Thread t1 = new Thread(() -> {
                while (true) {

                }
            });
            t1.start();
        }
    }

    public static void main1(String[] args) {
        List<t> list = new LinkedList<>();
        while (true) {
            list.add(new t());
        }
    }


}
